
function Toast(str){
    if(!Toast.obj){
        Toast.obj = {}
        Toast.obj.ele = document.createElement("dialog")
        document.body.appendChild(Toast.obj.ele)
    }

    Toast.obj.ele.innerHTML = str
    Toast.obj.ele.style.display = "block"

    clearTimeout(Toast.obj.t);
    Toast.obj.t = setTimeout(() => {
        Toast.obj.ele.style.display = "none"
        // this.ele.remove()
    }, 1000);

    return Toast.obj;
}


export default Toast;
